<template>
    <div class="comment">
        <!-- <p>评论<i class="fa fa-chevron-down" aria-hidden="true" @click="$emit('hideComment',false)"></i></p> -->
        <ul class="comment-ul">
            <li  class="comt"
                 v-for="comt in comment"
                :key="comt.commentId"
            >
                <div class="comment-top">
                    <div class="comment-top-left">
                        <img :src="comt.user.avatarUrl" />
                        <div>
                            <!-- 昵称 -->
                            <p>{{comt.user.nickname}}</p>
                            <!-- 评论时间 -->
                            <p>{{comt.time | dataTime}}</p>
                        </div>
                    </div>
                    <!-- 点赞 -->
                    <span>
                        <i class="fa fa-thumbs-up" aria-hidden="true"></i>
                        {{comt.likedCount}}</span>
                </div>
                <!-- 评论下部分 -->
                <p class="comment-bottom">{{comt.content}}</p>
            </li>
        </ul>
    </div>
</template>
<script>
export default {
    props:{
        comment:Array,
    },
    data(){
        return {
        }
    },
    created(){
        // console.log("this.comment==>",this.comment)
    }
}
</script>
<style lang="less" scoped>
    .comment-ul{
        padding: 0px 10px;
        // 评论上部分
        .comt{
            width: 100%;
            height: 105px;
            display: flex;
            flex-direction: column;
            border-bottom: 1px solid #cacccc56;;
            padding: 10px 10px 10px 0px;
            div.comment-top{
                width: 100%;
                height: 40px;
                display: flex;
                justify-content: space-between;
                .comment-top-left{
                    display: flex;
                    img{
                        width: 40px;
                        height: 40px;
                        display: block;
                        border-radius: 50%;
                    }
                    div{
                        p{
                            padding-left: 10px;
                            line-height: 18px;
                        }
                        p:nth-child(2){
                            font-size: 14px;
                            color: #626464;
                        }
                    }
                }
            }
            p.comment-bottom{
                line-height: 20px;
                flex: 1;
                padding-top: 5px;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 3;  //限制显示的文本数
                -webkit-box-orient: vertical;
            }
            
        }
        // 评论右部分
        
    }

</style>